package csc.daonjpa.java.domain;

import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Entity class for customer table. This is a simple POJO class with annotations
 * to define mapping with DB table
 * 
 * @author vuhuynh
 *
 */
@Entity
@Table(name = "customer")
public class Customer {

	// loginId field maps with number column in customer table
	// @Id indicates that loginId is the primary key for customer table
	@Id
	@Column(name = "loginId")
	private String loginId;

	@Column(name = "password")
	private String password;

	@Column(name = "firstName")
	private String firstName;

	@Column(name = "lastName")
	private String lastName;

	@Column(name = "address")
	private String address;

	@Column(name = "phone")
	private String phone;

	@OneToMany(mappedBy = "customer")
	private Collection<Account> account;

	public Collection<Account> getAccount() {
		return account;
	}

	public void setAccount(Collection<Account> account) {
		this.account = account;
	}


	public Customer() {

	}

	public Customer(String loginId, String password, String firstName,
			String lastName, String address, String phone) {
		super();
		this.loginId = loginId;
		this.password = password;
		this.firstName = firstName;
		this.lastName = lastName;
		this.address = address;
		this.phone = phone;
	}

	public String getLoginId() {
		return loginId;
	}

	public void setLoginId(String loginId) {
		this.loginId = loginId;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}



}
